//
// Created by dgy on 2023/1/6.
//
#include "iostream"
using namespace std;
int countEven(int num){
    int a[1000]={0},t=0,k=1;
    while (k<=1000){
        if (k<10){
            if (k%2==0){
                a[t]=k;
                t++;
            }
        }else if (k<100){
            int a1=k%10;
            int a2=(k/10)%10;
            if ((a1+a2)%2==0){
                a[t]=k;
                t++;
            }
        }else{
            int a1=k%10;
            int a2=(k/10)%10;
            int a3=(k/100)%10;
            if ((a1+a2+a3)%2==0){
                a[t]=k;
                t++;
            }
        }
        k++;
    }
    int t2=0;
    while(a[t2]!=0){
        cout<<a[t2]<<" ";
        t2++;
    }

    int count=0;
    int t1=0;
    while (a[t1]<=num){
        t1++;
        count++;
    }
    return count;
}
